package com.sxyjhh.dbutil.basic;

import java.util.TimerTask;

/**
 * Description:客户端任务类
 *
 * @JDK Version:1.8.0_40
 * Version: V1.0
 * Author: wangchun
 * Date: 2016/3/24 14:21
 */
public abstract class ClientTask extends TimerTask {

    private ClientTaskCallback clientTaskCallback;

    private Long period;

    public ClientTask() {
        super();
    }

    public void taskStarted(){
    }

    public void taskFinshed(TaskResultVo taskResultVo){
        clientTaskCallback.taskFinished(taskResultVo);
    }

    public void taskPartialData(TaskResultVo taskResultVo){
        clientTaskCallback.taskPartialData(taskResultVo);
    }

    public void setClientTaskCallback(ClientTaskCallback clientTaskCallback) {
        this.clientTaskCallback = clientTaskCallback;
    }

    public ClientTaskCallback getClientTaskCallback() {
        return clientTaskCallback;
    }

    public void setPeriod(long period) {
        this.period = period;
    }

    public Long getPeriod() {
        return period;
    }
}
